import axios from 'axios'
// import vue-axios from 'vue-axios'
var https = axios.create({
        baseURL: process.env.NODE_ENV == 'production' ? 'http://8.142.89.105:8081/' : 'http://8.142.89.105:8081/',
        timeout: 3000,
        // headers:{},
    })
    //请求拦截器
https.interceptors.request.use(function(config) {
        return config
    }, function(error) {
        return Promise.reject(error)
    })
    //响应拦截器
https.interceptors.response.use(function(response) {
    let data = response.data;
    if (data.status == 5000) {
        alert('数据错误')
    }
    return false
}, function(error) {
    alert('系统繁忙')
    return Promise.reject(error)
})
export default https